{extend name="layout" /}
{block name="body"}
  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-body">
          
          <form action="{:url('editField')}" method="post" name="edit-form" class="row edit-form">
            <div class="form-group col-md-12">
              <label for="pid">字段名称</label>
              <div class="form-controls">
                <input type="text" class="form-control" id="title" name="title" value="{$info.title}" placeholder="请输入字段中文名" />
                <small class="form-text text-muted">(必填，32个字符以内!)</small>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="en_title">字段英文名</label>
              <div class="form-controls">
                <input type="text" class="form-control" id="en_title" name="en_title" value="{$info.en_title}" placeholder="请输入字段的英文名称" />
                <small class="form-text text-muted">(必填，由小写英文字母和下划线组成，32个字符以内!)</small>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="type">字段类型</label>
              <div class="form-controls">
                <select class="form-control selectpicker" id="type" name="type">
                  {volist name="Think.config.app.site_setting.form_item_type" id="type"}
                  <option value="{$key}" {if condition="$info.type == $key"}selected{/if}>{$type}</option>
                  {/volist}
                </select>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="define">字段定义</label>
              <div class="form-controls">
                <input type="text" class="form-control" id="define" name="define" value="{$info.define}" placeholder="请输入字段定义" />
                <small class="form-text text-muted">(可根据实际需求自行填写或修改，但必须是正确的sql语法)</small>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="value">字段默认值</label>
              <div class="form-controls">
                <input type="text" class="form-control" id="value" name="value" value="{$info.value}" placeholder="请输入字段默认值" />
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="remark">字段说明</label>
              <div class="form-controls">
                <textarea class="form-control" id="remark" rows="3" name="remark" placeholder="请输入字段说明">{$info.remark}</textarea>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label for="sort">排序</label>
              <input type="text" class="form-control" id="sort" name="sort" value="{$info.sort}" />
            </div>
            <div class="form-group col-md-12">
              <label>是否显示</label>
              <div class="form-controls clearfix">
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" id="showOne" name="show" class="custom-control-input" value="0" {if condition="$info.show == 0"}checked{/if}>
                  <label class="custom-control-label" for="showOne">禁用</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" id="showTwo" name="show" class="custom-control-input" value="1" {if condition="$info.show == 1"}checked{/if}>
                  <label class="custom-control-label" for="showTwo">启用</label>
                </div>
                <small class="form-text text-muted">新增或编辑时是否显示该字段</small>
              </div>
            </div>
            <div class="form-group col-md-12">
              <label>状态</label>
              <div class="form-controls clearfix">
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" id="statusOne" name="status" class="custom-control-input" value="0" {if condition="$info.status == 0"}checked{/if}>
                  <label class="custom-control-label" for="statusOne">禁用</label>
                </div>
                <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" id="statusTwo" name="status" class="custom-control-input" value="1" {if condition="$info.status == 1"}checked{/if}>
                  <label class="custom-control-label" for="statusTwo">启用</label>
                </div>
              </div>
            </div>
            <div class="form-group col-md-12">
              <input type="hidden" name="id" value="{$info.id}" />
              <input type="hidden" name="model_id" value="{$info.model_id}" />
              <button type="submit" class="btn btn-primary m-r-5 ajax-post" target-form="edit-form">确 定</button>
              <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>
          </form>
 
        </div>
      </div>
    </div>
    
  </div>
{/block}